*******************************************************************************************
*******************************************************************************************
******************** Reclassification Risk in the Small Group Health Insurance Market
******************* by Sebastian Fleitas, Gautam Gowrisankaran and Anthony Lo Sasso 
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
******************** Table B2 
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************

 

cd "/Users/sebastianfleitas/Dropbox/ReclassificationRisk"
use database_individual_level.dta, replace 


sort mbr_sys_id year 

reg acg_riskscore laggedscore marketdum*  , vce(cluster customer_number)
reg acg_riskscore laggedscore L.laggedscore marketdum*  , vce(cluster customer_number)
gen sample = e(sample) 
reg acg_riskscore laggedscore marketdum* if sample==1  , vce(cluster customer_number)


clear all 
cd "~/Dropbox/ReclassificationRisk/" 

use datasetindviduals_restat_revisions.dta, clear 

collapse (mean) mean_premium mean_pred_riskscore_rp paid_sum allowed_sum acg_riskscore acg_concurrent, by(customer_number market year)
tab(year), gen(yeardum)
tab(market), gen(marketdum) 

egen firm = group(customer_number) 
xtset firm year

reg acg_riskscore mean_pred_riskscore_rp , vce(cluster customer_number)
reg acg_riskscore mean_pred_riskscore_rp L.mean_pred_riskscore_rp if year>2013 , vce(cluster customer_number)
gen sample = e(sample) 
reg acg_riskscore mean_pred_riskscore_rp if sample==1, vce(cluster customer_number)
